package org.moda.common;

import java.util.function.Supplier;

public class Try {
    public static <T> Either<Throwable, T> of(Supplier<T> f) {
        try {
            return Either.right(f.get());
        }catch (Throwable e) {
            return Either.left(e);
        }
    }
}